 
 
 
<!DOCTYPE html>
<html>
{include file="public/head"}
<body>

{include file="public/nav"}

{include file="community/nav"}
<div class="layui-container">

    <div class="addtopic-content">
        <h1 class="addtopic-title">撰写文章</h1>
        <hr />
        <form action="{:url('web/Community/do_addtopic')}" method="post" class="layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label">文章标题：</label>
                <div class="layui-input-inline">
                    <input type="text" name="title" required lay-verify="required" placeholder="输入标题" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">标题为必填项</div>
            </div>
            
            <div class="layui-form-item">
                <label class="layui-form-label">题目ID：</label>
                <div class="layui-input-inline">
                    {if condition="$pid!=null"}
                    <input type="text" name="pid" placeholder="题目ID" autocomplete="off" class="layui-input layui-disabled" value="{$pid}" readonly="true" >
                    {else /}
                    <input type="text" name="pid" placeholder="题目ID" autocomplete="off" class="layui-input" value="">
                    {/if}
                    
                </div>
                <div class="layui-form-mid layui-word-aux">可选项,填写代表该文章讨论的是某一题目</div>
            </div>

            <div id="test-editormd" class="nyoj-clear-width">
                <textarea style="display:none;" name="content"></textarea>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                </div>
            </div>
        </form>
</div>
 {include file="public/foot"}
</body>
 <script src="__STATIC__/markdown/examples/js/jquery.min.js"></script>
 <script src="__STATIC__/markdown/editormd.min.js"></script>
<script type="text/javascript">
			var testEditor;
$(function() {
                editormd.urls.atLinkBase = "{:url('web/Account/info')}/";
                testEditor = editormd("test-editormd", {
                    width           : "90%",
                    height          : 540,
                    tex              : true,
                    codeFold         : true,
                    path            : "__STATIC__/markdown/lib/",
                    watch           : true,           // disable watch
                    styleActiveLine : true,   // disable active line
                    imageUpload : true,
                    imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
                    imageUploadURL : "/api/uploadimage?md=true",
                    //lineNumbers     : false      // hide line numbers
                });
            });
</script>
</html>